home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / c / library / dos / communic / pcmail / main / implemen < prev    next >
Encoding:
Text File  |  1994-06-05  |  4.7 KB  |  127 lines

  1. @(#) Implement 2.1 90/01/22 13:01:08
  2.  
  3.  
  4.  
  5. This document describes some implementation aspects of the pc-mail
  6.  
  7. software.
  8.  
  9.  
  10.  
  11. MESSAGE DATA BASE
  12.  
  13.  
  14.  
  15. The message data base resides in the mail  spool  directory  (de-
  16.  
  17. fined  with  the MAILDIR environment variable). There are various
  18.  
  19. classes of message files:
  20.  
  21.  
  22.  
  23.  - mail received from the network
  24.  
  25.  
  26.  
  27.  - mail ready to send over the network
  28.  
  29.  
  30.  
  31.  - messages in preparation
  32.  
  33.  
  34.  
  35.  - mail that has been sent
  36.  
  37.  
  38.  
  39. In addition there are administrative files (LOGFILE,  alias  data
  40.  
  41. base and communications parameters). Optional files  are:  header
  42.  
  43. (with  template  message  header)  and  trailer  (with the user's
  44.  
  45. signature).
  46.  
  47.  
  48.  
  49. Each message takes two files: a data file (with the  actual  mes-
  50.  
  51. sage)  and a meta file (with on the  first  line:  originator  or
  52.  
  53. destination addresses, or a one-line summary in case of a message
  54.  
  55. in preparation; and on the second line: a subject).
  56.  
  57.  
  58.  
  59. Data/meta file names are constructed by concatenating  a  single-
  60.  
  61. character prefix with a five-digit sequence number. Corresponding
  62.  
  63. data and meta files have the same  sequence  number.  The  prefix
  64.  
  65. characters are:
  66.  
  67.  
  68.  
  69.  E message in preparation
  70.  
  71.  C description of message
  72.  
  73.  
  74.  
  75.  N message received from the net
  76.  
  77.  H originator address and subject in case of an unread message
  78.  
  79.  O originator address and subject in case of already read message
  80.  
  81.  
  82.  
  83.  D message ready to be sent over the net
  84.  
  85.  X destination of that message and subject
  86.  
  87.  
  88.  
  89.  Q message already sent over the net
  90.  
  91.  R destination of that message and subject
  92.  
  93.  
  94.  
  95. Administrative files are
  96.  
  97.  
  98.  
  99.  LOGFILE transaction log
  100.  
  101.  s00000 communications parameters
  102.  
  103.  a00000 alias data base
  104.  
  105.  
  106.  
  107. All files in the mail directory are ordinary text files,  with  a
  108.  
  109. possible  exception  for the message in preparation (this depends
  110.  
  111. on the editor being used).
  112.  
  113.  
  114.  
  115. Files in the  mail  directory  are  normally  write-protected  to
  116.  
  117. prevent accidents.
  118.  
  119.  
  120.  
  121. The length of lines in the "meta" files is  at  most  1024  bytes
  122.  
  123. (see the MAXLINE macro in the file defs.h).
  124.  
  125.  
  126.  
  127. Most mailers will object to messages with lines longer than about
  128.  
  129. 132 characters.
  130.  
  131.  
  132.  
  133. HOW THE PROGRAMS OPERATE
  134.  
  135.  
  136.  
  137. The message data base is shared by  several  programs.  First  of
  138.  
  139. all, there is the mail program itself that provides the main user
  140.  
  141. interface. Other programs are: cico (takes unsent  messages  from
  142.  
  143. the mail data base, and changes their status to "sent" after they
  144.  
  145. have been sent over the network), smail  (queues  a  message  for
  146.  
  147. transmission  by  the  cico  program), rmail (extracts originator
  148.  
  149. names and subject information from messages received by the  cico
  150.  
  151. program)  and  cmail  (scans  the  mail  data  base  for   unread
  152.  
  153. messages).  If  the mail directory is mounted from a file server,
  154.  
  155. the cico program is not used; instead, its task is  performed  by
  156.  
  157. the  pc-mail  and  pc-maild  daemon programs that run on the file
  158.  
  159. server.
  160.  
  161.  
  162.  
  163. The following picture shows how the programs interact  with  each
  164.  
  165. other, and with the mail data base.
  166.  
  167.  
  168.  
  169. -----------------------------------------------------------------
  170.  
  171. program    |purpose            |invokes
  172.  
  173. --------+-------------------------------+--------------------------
  174.  
  175. mail    |main user interface        |cico, smail, rmail, editor
  176.  
  177.     |                |
  178.  
  179. cico    |file transfer program        |none; invoked by mail, cmail
  180.  
  181.     |                |
  182.  
  183. smail    |queue file for transmission    |none; invoked by mail
  184.  
  185.     |                |
  186.  
  187. rmail    |extract sender and subject    |none; invoked by mail, cmail
  188.  
  189.     |                |
  190.  
  191. cmail    |search for unread mail        |none
  192.  
  193. --------+-------------------------------+--------------------------
  194.  
  195. pc-mail    |deliver mail (on file server)    |none; invoked by sendmail
  196.  
  197.     |                |
  198.  
  199. pc-maild|send mail (on file server)    |/usr/bin/rmail
  200.  
  201. -------------------------------------------------------------------
  202.  
  203.  
  204.  
  205. UUCP FUNCTIONALITY
  206.  
  207.  
  208.  
  209. The cico program provided here supports a subset of the uucp file
  210.  
  211. exchange  facilities,  just  enough  to  interface to the message
  212.  
  213. database structure (spool directory) described  in  the  previous
  214.  
  215. section.
  216.  
  217.  
  218.  
  219. The main differences with the unix uucico program are:
  220.  
  221.  
  222.  
  223. - No  support  for  C  (command)  files.  cico  scans  the  spool
  224.  
  225. directory for message and destination files instead.
  226.  
  227.  
  228.  
  229. - Only the H  (hangup),  S  (send)  and  C  (copy)  requests  are
  230.  
  231. supported.  R  (receive)  requests  are  not allowed.  Sending or
  232.  
  233. receiving files by path name is rarely allowed anyway, and  works
  234.  
  235. only  between  adjacent  uucp  nodes.  This  is  only   a   minor
  236.  
  237. limitation; files can still be sent as mail messages.
  238.  
  239.  
  240.  
  241. - The cico program assumes that all incoming D (data)  files  are
  242.  
  243. mail messages.
  244.  
  245.  
  246.  
  247. - The cico program ignores incoming X (execute)  files.  X  files
  248.  
  249. normally contain the commands to dispose of D (data) files.
  250.  
  251.  
  252.  
  253.